# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-proglog
pkgname=('python2-proglog' 'python-proglog')
_pkgname=proglog
pkgver=0.1.12
pkgrel=1
pkgdesc='Logs and progress bars manager for Python.'
arch=('any')
url='https://pypi.org/project/proglog/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools' 'python2-wheel'
             'python-wheel' 'python2-pip' 'python-pip')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('74f610ed82a3fc1aac9ad6cf7ea3a5b7fef281c9abdf4b2f38f61e8ac160689544dc88e49209fecb93e4001d0c5054a4f064c2d9f0b59aacce772bfb89ce5af8')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-proglog() {
  depends=('python2' 'python2-tqdm')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-proglog() {
  depends=('python' 'python-tqdm')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

